Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CompletableFuture for method return types #638

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

wjam
Copy link
Contributor

@wjam wjam commented Feb 8, 2018

Implements support for CompletableFuture on method return types by converting through RxJava Observable

@kdavisk6
Copy link
Member

There are few things that will help make this PR ready for review. Please see CONTRIBUTING for more information.

Also, this does appear to push Java version up. In the past we have tried not to do this, for various reasons. Take a look at HACKING for more tips. If this feature gets enough support, it may be better of in a new feign-hystrix-java8 module.

Copy link
Member

@kdavisk6 kdavisk6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've spent a little more time researching this. Hystrix does not support CompleteableFuture internally. Your implementation uses a common workaround, by turning the future into an Observable. It is my opinion that until Hystrix supports this directly, we consider this a JDK8 only update and move it to the jdk8 module, separating it from Hystrix entirely.

.editorconfig Outdated
@@ -0,0 +1,14 @@
# top-most EditorConfig file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should be including editor configuration files this way.


import java.util.concurrent.CompletableFuture;

@IgnoreJRERequirement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't like this kind of thing. If this code requires JDK8, then it should be in the jdk8 module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any strong reason for our current java 6 constraint?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is my understanding, from reading previous comments and documentation from @adriancole, it is the opinion of this project that core feign should remain JDK 6+ and that all JDK 8 features are in the feign-java8 module. This PR will require core feign to move to JDK 8, which has been called out in other PR and issues before as something we should try to avoid.

Personally, I do not have a strong opinion on this. My questions and thoughts are an attempt to stay consistent. I am open to having a discussion with the other contributors to see if we should revisit this decision.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change to jdk 8 baseline should require a major revision (ie 10.x)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to jdk 8 baseline should require a major revision (ie 10.x)

LGTM =)

@kdavisk6
Copy link
Member

kdavisk6 commented Jul 6, 2018

@wjam Master is now Java 8, if you still want this PR to move forward, can you take a look and see if you can apply it to the new baseline?

Implements support for `CompletableFuture` on method return types by converting through RxJava `Observable`
@wjam wjam force-pushed the completable-futures branch from 4816937 to e67c8f2 Compare July 8, 2018 13:24
@kdavisk6 kdavisk6 added waiting for feedback Issues waiting for a response from either to the author or other maintainers enhancement For recommending new capabilities and removed waiting for feedback Issues waiting for a response from either to the author or other maintainers labels Jul 16, 2018
@kdavisk6
Copy link
Member

kdavisk6 commented Sep 9, 2018

@wjam This PR limits support to HystrixFeign only. Would it be possible to update this PR to add general support for CompleteableFuture outside of Hystrix?

@kdavisk6 kdavisk6 added the waiting for feedback Issues waiting for a response from either to the author or other maintainers label Sep 14, 2018
@velo velo merged commit 9dfd9b4 into OpenFeign:master Nov 15, 2018
@wjam wjam deleted the completable-futures branch November 15, 2018 20:28
velo pushed a commit that referenced this pull request Oct 7, 2024
Implements support for `CompletableFuture` on method return types by converting through RxJava `Observable`
velo pushed a commit that referenced this pull request Oct 8, 2024
Implements support for `CompletableFuture` on method return types by converting through RxJava `Observable`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For recommending new capabilities waiting for feedback Issues waiting for a response from either to the author or other maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants